package com.itheima.bos.dao;

import com.itheima.bos.utils.PageBean;
import org.hibernate.criterion.DetachedCriteria;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * Created by Mr.King on 2017/3/7.
 */
public interface IBaseDao<T> {

    //保存
    public void save(T t);

    //保存修改
    public void saveOrUpdate(T t);

    //删除
    public void delete(T t);

    //更新
    public void update(T t);

    //查找
    public T findById(Serializable id);

    //查找所有
    public List<T> findAll();

    //根据条件查询
    public List<T> findCriteria(DetachedCriteria criteria);

    //根据命名语句查询
    public List<T> findNameQuery(String nameQuery, Object... args);

    //执行增删改操作的命令语句
    public void executeNameQuery(String nameQuery, Object... args);

    //分页查询
    public void pageQuery(PageBean pageBean);

}
